<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>预定义常量</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="sqlite.resources.html">资源类型</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="ref.sqlite.html">SQLite 函数</a></div>
 <div class="up"><a href="book.sqlite.html">SQLite</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="sqlite.constants" class="appendix">
 <h1>预定义常量</h1>

 <p class="simpara">下列常量由此扩展定义，且仅在此扩展编译入 PHP 或在运行时动态载入时可用。</p>
 <p class="para">
  The functions <span class="function"><a href="function.sqlite-fetch-array.html" class="function">sqlite_fetch_array()</a></span> and
  <span class="function"><a href="function.sqlite-current.html" class="function">sqlite_current()</a></span> use a constant for
  the different types of result arrays. The following constants are
  defined:
 </p>
 <dl>

  <strong class="title">SQLite result type constants</strong>
  
   <dt id="constant.sqlite-assoc">
    <strong><code>SQLITE_ASSOC</code></strong> 
    (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     Columns are returned into the array having the field name as the array
     index.
    </span>
   </dd>

  
  
   <dt id="constant.sqlite-both">
    <strong><code>SQLITE_BOTH</code></strong> 
    (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     Columns are returned into the array having both a numerical index
     and the field name as the array index.
    </span>
   </dd>

  
  
   <dt id="constant.sqlite-num">
    <strong><code>SQLITE_NUM</code></strong> 
    (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     Columns are returned into the array having a numerical index to the
     fields. This index starts with 0, the first field in the result.
    </span>
   </dd>

  
 </dl>

 <p class="para">
  A number of functions may return status codes.  The following constants are
  defined:
 </p>
 <dl>

  <strong class="title">SQLite status code constants</strong>
  
   <dt id="constant.sqlite-ok">
    <strong><code>SQLITE_OK</code></strong> 
    (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     Successful result.
    </span>
   </dd>

  
  
   <dt id="constant.sqlite-error">
    <strong><code>SQLITE_ERROR</code></strong> 
    (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     SQL error or missing database.
    </span>
   </dd>

  
  
   <dt id="constant.sqlite-internal">
    <strong><code>SQLITE_INTERNAL</code></strong> 
    (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     An internal logic error in SQLite.
    </span>
   </dd>

  
  
   <dt id="constant.sqlite-perm">
    <strong><code>SQLITE_PERM</code></strong> 
    (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     Access permission denied.
    </span>
   </dd>

  
  
   <dt id="constant.sqlite-abort">
    <strong><code>SQLITE_ABORT</code></strong> 
    (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     Callback routine requested an abort.
    </span>
   </dd>

  
  
   <dt id="constant.sqlite-busy">
    <strong><code>SQLITE_BUSY</code></strong> 
    (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     The database file is locked.
    </span>
   </dd>

  
  
   <dt id="constant.sqlite-locked">
    <strong><code>SQLITE_LOCKED</code></strong> 
    (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     A table in the database is locked.
    </span>
   </dd>

  
  
   <dt id="constant.sqlite-nomem">
    <strong><code>SQLITE_NOMEM</code></strong> 
    (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     Memory allocation failed.
    </span>
   </dd>

  
  
   <dt id="constant.sqlite-readonly">
    <strong><code>SQLITE_READONLY</code></strong> 
    (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     Attempt to write a readonly database.
    </span>
   </dd>

  
  
   <dt id="constant.sqlite-interrupt">
    <strong><code>SQLITE_INTERRUPT</code></strong> 
    (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     Operation terminated internally.
    </span>
   </dd>

  
  
   <dt id="constant.sqlite-ioerr">
    <strong><code>SQLITE_IOERR</code></strong> 
    (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     Disk I/O error occurred.
    </span>
   </dd>

  
  
   <dt id="constant.sqlite-notadb">
    <strong><code>SQLITE_NOTADB</code></strong> 
    (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     File opened that is not a database file.
    </span>
   </dd>

  
  
   <dt id="constant.sqlite-corrupt">
    <strong><code>SQLITE_CORRUPT</code></strong> 
    (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     The database disk image is malformed.
    </span>
   </dd>

  
  
   <dt id="constant.sqlite-format">
    <strong><code>SQLITE_FORMAT</code></strong> 
    (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     Auxiliary database format error.
    </span>
   </dd>

  
  
   <dt id="constant.sqlite-notfound">
    <strong><code>SQLITE_NOTFOUND</code></strong> 
    (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     (Internal) Table or record not found.
    </span>
   </dd>

  
  
   <dt id="constant.sqlite-full">
    <strong><code>SQLITE_FULL</code></strong> 
    (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     Insertion failed because database is full.
    </span>
   </dd>

  
  
   <dt id="constant.sqlite-cantopen">
    <strong><code>SQLITE_CANTOPEN</code></strong> 
    (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     Unable to open the database file.
    </span>
   </dd>

  
  
   <dt id="constant.sqlite-protocol">
    <strong><code>SQLITE_PROTOCOL</code></strong> 
    (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     Database lock protocol error.
    </span>
   </dd>

  
  
   <dt id="constant.sqlite-empty">
    <strong><code>SQLITE_EMPTY</code></strong> 
    (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     (Internal) Database table is empty.
    </span>
   </dd>

  
  
   <dt id="constant.sqlite-schema">
    <strong><code>SQLITE_SCHEMA</code></strong> 
    (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     The database schema changed.
    </span>
   </dd>

  
  
   <dt id="constant.sqlite-toobig">
    <strong><code>SQLITE_TOOBIG</code></strong> 
    (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     Too much data for one row of a table.
    </span>
   </dd>

  
  
   <dt id="constant.sqlite-constraint">
    <strong><code>SQLITE_CONSTRAINT</code></strong> 
    (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     Abort due to constraint violation.
    </span>
   </dd>

  
  
   <dt id="constant.sqlite-mismatch">
    <strong><code>SQLITE_MISMATCH</code></strong> 
    (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     Data type mismatch.
    </span>
   </dd>

  
  
   <dt id="constant.sqlite-misuse">
    <strong><code>SQLITE_MISUSE</code></strong> 
    (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     Library used incorrectly.
    </span>
   </dd>

  
  
   <dt id="constant.sqlite-nolfs">
    <strong><code>SQLITE_NOLFS</code></strong> 
    (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     Uses of OS features not supported on host.
    </span>
   </dd>

  
  
   <dt id="constant.sqlite-auth">
    <strong><code>SQLITE_AUTH</code></strong> 
    (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     Authorized failed.
    </span>
   </dd>

  
  
   <dt id="constant.sqlite-row">
    <strong><code>SQLITE_ROW</code></strong> 
    (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     Internal process has another row ready.
    </span>
   </dd>

  
  
   <dt id="constant.sqlite-done">
    <strong><code>SQLITE_DONE</code></strong> 
    (<span class="type"><a href="language.types.integer.html" class="type int">int</a></span>)
   </dt>

   <dd>

    <span class="simpara">
     Internal process has finished executing.
    </span>
   </dd>

  
 </dl>

</div>
<hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="sqlite.resources.html">资源类型</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="ref.sqlite.html">SQLite 函数</a></div>
 <div class="up"><a href="book.sqlite.html">SQLite</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
